<template>
	<view class="container">
		<top-back-navbar position="fixed" title="钱包" background="#000" color="#fff"></top-back-navbar>


		<view class="header">
			<view class="header-box" @click="$u.route('/pages/member/info/info')">
				<image :src="res.avatar || '/static/haibei/avatar.png'" class="face"></image>
				<view class="right_header_box">
					<view class="user-levelname">{{res.ishaveagent}}</view>
					<view class="user-id">ID号：{{res.yqm ||''}}</view>
					<view class="user-name">{{res.nickname || '游客'}}</view>

				</view>
			</view>
		</view>
	
		<view class="qianbao-list">
			<view class="qianbao-list-item">
				<view class="qianbao-item">
					<view class="qianbao-item-list"
						@click="$u.route(`/pagesSM/mine_detailed/mine_detailed?type=life_money`)">
						<view class="qianbao-name">我的收益</view>
						<view class="qianbao-icon qianbao-icon-border">明细</view>
					</view>
					<view class="qianbao-item-list" @click="$u.route('/pages/member/details/tx/txc?type=5')">
						<view class="qianbao-money">{{res.credit2 || '0.00'}}</view>
						<view class="qianbao-icon qianbao-icon-bg">提现</view>
					</view>
				</view>
				
				<view class="qianbao-item"
					@click="$u.route(`/pagesSM/mine_detailed/mine_detailed?type=life_equity`)">
					<view class="qianbao-item-list">
						<view class="qianbao-name">分红券</view>
						<view class="qianbao-icon qianbao-icon-border">明细</view>
					</view>
					<view class="qianbao-item-list">
						<view class="qianbao-money">{{res.life_equity || '0.00'}}</view>
						<view class="qianbao-icon"></view>
					</view>
				</view>
			</view>
		</view>
		<view class="qianbao-list">
			<view class="qianbao-list-item">
				<view class="qianbao-item"
					@click="$u.route(`/pagesSM/mine_detailed/mine_detailed?type=life_equity_credits`)">
					<view class="qianbao-item-list">
						<view class="qianbao-name">仓量</view>
						<view class="qianbao-icon qianbao-icon-border">明细</view>
					</view>
					<view class="qianbao-item-list">
						<view class="qianbao-money">{{res.life_equity_credits || '0.00'}}</view>
						<view class="qianbao-icon"></view>
					</view>
				</view>
				<view class="qianbao-item qianbao-border"
					@click="$u.route(`/pagesSM/mine_detailed/mine_detailed?type=life_cd`)">
					<view class="qianbao-item-list">
						<view class="qianbao-name">仓单</view>
						<view class="qianbao-icon qianbao-icon-border">明细</view>
					</view>
					<view class="qianbao-item-list">
						<view class="qianbao-money">{{res.life_cd || '0'}}</view>
						<!-- <view class="qianbao-money">{{res.sign_bucket || '0'}}</view> -->
					</view>
				</view>
			</view>
		</view>
		<view class="qianbao-list">
			<view class="qianbao-list-item">
				<view class="qianbao-item"
					@click="$u.route(`/pagesSM/mine_detailed/mine_detailed?type=hb_intgral`)">
					<view class="qianbao-item-list">
						<view class="qianbao-name">兑换券</view>
						<view class="qianbao-icon qianbao-icon-border">明细</view>
					</view>
					<view class="qianbao-item-list">
						<view class="qianbao-money">{{res.hb_intgral || '0.00'}}</view>
						<view class="qianbao-icon"></view>
					</view>
				</view>
				<view class="qianbao-item qianbao-border"
					@click="$u.route(`/pagesSM/qianbao/suanlichi`)">
					<view class="qianbao-item-list">
						<view class="qianbao-name">算力池</view>
						<view class="qianbao-icon qianbao-icon-border">明细</view>
					</view>
					<view class="qianbao-item-list">
						<view class="qianbao-money">{{res.suanli_num || '0'}}</view>
						<!-- <view class="qianbao-money">{{res.sign_bucket || '0'}}</view> -->
					</view>
				</view>
			</view>
		</view>
		

		<view style="height: 100rpx;"></view>
		<u-toast ref="uToast"></u-toast>
		<tabbars :current="0"></tabbars>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				tzz: '0',
				credit2: '0',
				bz: '0',
				a_kzp: '0',
				credit1: '0',
				nickname: '游客',
				avatar: '../../static/33.jpg',
				res: [],
				is_realname: '',
				active: "active",
				openid: '',
				data: [],
			};
		},
		onLoad: function() {
			this.$GetOpenid().then(res => {
				this.openid = res;
				this.setAjax()
			})
		},
		methods: {
			setAjax() {
				uni.request({
					url: this.$BASE_URL +
						'/index.php?i=2&c=entry&m=ewei_shopv2&do=mobile&r=member&app=1&type=life',
					method: 'POST',
					data: {
						'openid': this.openid
					},
					header: {
						'Content-Type': 'application/x-www-form-urlencoded'
					},
					success: res => {
						console.log(res)
						uni.hideLoading()
						this.res = res.data
						this.is_realname = res.data.is_realname
						var order = this.order
						for (var i in order) {
							this.order[i].badge = res.data.order[i]
						}
					},
					fail: () => {},
					complete: () => {}
				});
			},
			jumpno() {
				uni.showModal({
					title: '提示',
					content: '功能即将开放',
					showCancel: false,
					confirmColor: "#DD524D",
					success() {
						return
					}
				})
			}
		}
	}
</script>

<style lang="scss">
	page {

		margin: 0;
		padding: 0;
	}

	.container {
		height: 100vh;
		background: url('../../static/haibei/bg.png') 0 -110rpx no-repeat;
		background-size: 100% 120%;
	}


	.header {

		// padding: 30rpx;
		// background-color: #d52d22;
		.header-box {

			display: flex;
			padding: 40rpx 0 20rpx 50rpx;
			align-items: center;

			// margin: 0 auto;
			.face {
				width: 200rpx;
				height: 200rpx;
				border-radius: 50%;
				background-color: #fff;
			}

			.right_header_box {
				flex: 1;
				padding-left: 50rpx;

				.user-name {
					font-size: 35rpx;
				}

				.user-levelname {
					font-size: 35rpx;
				}

				.user-id {
					font-size: 35rpx;
				}
			}

		}
	}

	.qianbao-title {
		padding: 30rpx 30rpx 0 30rpx;
		font-size: 32rpx;
		font-weight: bold;
		color: #000;
	}

	.qianbao-list {
		padding: 30rpx 20rpx 0 20rpx;
		
		.qianbao-list-item {
			// padding: 30rpx 20rpx;
			display: flex;
			border-radius: 20rpx;
			// box-shadow: 0px 2px 8px 3px rgba(235, 235, 235, 0.4);
			// background-color: #fff;
			justify-content: space-between;
			align-content: flex-start;
			flex-wrap: wrap;

			.qianbao-item-list {
				display: flex;
				align-items: center;
				justify-content: space-between;
				height: 70rpx;
			}

			.qianbao-item-list1 {
				height: 60rpx;
				line-height: 60rpx;
				text-align: center;
				font-size: 32rpx;
				color: #000;
			}

			.qianbao-item-list2 {
				height: 60rpx;
				line-height: 60rpx;
				text-align: center;
				font-size: 36rpx;
				font-weight: bold;
				color: #d52d22;
			}

			.qianbao-item {
				width: 50%;
				height: 88px;
				position: relative;
				background: url('../../static/haibei/item_bg.png') 0 0 no-repeat;
				background-size: 100% 100%;
				padding: 10rpx;
				.qianbao-name {
					font-size: 34rpx;
					color: #000;
				}

				.qianbao-money {
					font-size: 34rpx;
					font-weight: bold;
					min-height: 36rpx;
					font-family: NumFonts !important;
				}

				.qianbao-icon {
					font-size: 28rpx;
					width: 110rpx;
					height: 50rpx;
					line-height: 50rpx;
					border-radius: 50rpx;
					text-align: center;
					
				}

				.qianbao-icon-border {
					border: 1px solid #888;
					color: #888;
				}

				.qianbao-icon-bg {
					border: 1px solid #81551b;
					background-color: #81551b;
					color: #fff;
				}
			}

			.qianbao-border {
				border-left: 1px solid #e0e0e0;
			}
		}
	}

	.sale-title {
		font-size: 32rpx;
		font-weight: bold;
		padding: 30rpx 0 12rpx 30rpx;
	}
</style>